import Axios from "axios"
import { backstageUrl } from "../config";

// const backstageUrl = 'https://tidukeji.cn/SchoolSecurityService1/';

export const getSchoolSecurityRankApi = (schooltype, educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getSchoolSecurityRank", {
        params: {
            schooltype: schooltype,
            educationId: educationId
        }
    });
}

export const getCountySecurityRankApi = (parent) => {
    return Axios.get(backstageUrl + "edudailystatistics/getCountySecurityRank", {
        params: {
            parent: parent
        }
    });
}

export const getYesterdayStatisticApi = () => {
    return Axios.get(backstageUrl + "edudailystatistics/getYesterdayStatistic", {

    })
}

export const getYesterdayStatisticByEduIdApi = (parent) => {
    return Axios.get(backstageUrl + "edudailystatistics/getYesterdayStatisticByEduId", {
        params: {
            parent: parent
        }
    })
}

// 县级安全隐患

export const getDangerCategoryDistributionApi = (educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getDangerCategoryDistribution", {
        params: {
            educationId: educationId
        }
    })

}

// 市级安全隐患

export const getMDangerCategoryDistributionApi = (parent) => {
    return Axios.get(backstageUrl + "edudailystatistics/getMDangerCategoryDistribution", {
        params: {
            parent: parent
        }
    })

}


export const getSchoolNumApi = (parent) => {
    return Axios.get(backstageUrl + "eduDepartmentManagement/getSchoolNum", {
        params: {
            parent: parent
        }
    })
}


// 累计统计数据
export const getTotalStatisticByEduIdApi = (educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getTotalStatisticByEduId", {
        params: {
            educationId: educationId
        }
    })
}


// 全市巡检、巡更数
export const getStatisticMonthlyApi = (parent) => {
    return Axios.get(backstageUrl + "edudailystatistics/getStatisticMonthly", {
        params: {
            parent: parent
        }
    })
}

// 学校综合排名
export const getSchoolRankApi = (parent) => {
    return Axios.get(backstageUrl + "edudailystatistics/getSchoolRank", {
        params: {
            parent: parent
        }
    })
}


// 巡更、巡检参与人数
export const getAttendanceApi = (parent) => {
    return Axios.get(backstageUrl + "edudailystatistics/getAttendance", {
        params: {
            parent: parent
        }
    })
}

// 全市累计巡更、巡检数
export const getTotalStatisticApi = (educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getTotalStatistic", {
        params: {
            educationId: educationId
        }
    })
}


// 市级校内网格数
// export const getGridNumApi = () => {
//     return Axios.get(backstageUrl + "edudailystatistics/getGridNum", {

//     })
// }

// 区县校内网格数
export const getGridNumByEduIdApi = (educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getGridNumByEduId", {
        params: {
            educationId: educationId
        }
    })
}

// 市级校园网格人员数
// export const getSchoolGridNumOfPeopleApi = () => {
//     return Axios.get(backstageUrl + "edudailystatistics/getSchoolGridNumOfPeople", {

//     })
// }

// 区县校园网格人员数
export const getSchoolGridNumOfPeopleByEduIdApi = (educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getSchoolGridNumOfPeopleByEduId", {
        params: {
            educationId: educationId
        }
    })
}

// 区县校外网格人员数
export const getSchoolGridOutNumOfPeopleByEduIdApi = (educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getSchoolGridOutNumOfPeopleByEduId", {
        params: {
            educationId: educationId
        }
    })
}


// 校园安全隐患词云
export const getSchoolDangerWordCloudApi = (educationId) => {
    return Axios.get(backstageUrl + "edudailystatistics/getSchoolDangerWordCloud", {
        params: {
            educationId: educationId
        }
    })
}

//大屏接口安全
export let getScreenSecretApi = (name, key) => {
    return (
        Axios.post(backstageUrl + "bigscreenSecurity/getScreenSecret", {
           name: name,
           key:key
        })
    );
}
//大屏接口安全 -- 密钥对比
export let compareSecretAndExpireTimeApi = (secret) => {
    return (
        Axios.post(backstageUrl + "bigscreenSecurity/compareSecretAndExpireTime", {
           secret: secret
        })
    );
}
